<!--
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				StaffProject.jsp
  //	TITLE:				Local Cost
  //	FUNCTION:			Add or Update Staff Project.
  //	BY:					Beyes Xia
  //	DATE:				16/12/2003
  // --------------------------------------------------------------
-->

<%@ include file="../tssheader.jsp"   %>
<%@ page import="tss.staffproject.*" %>
<%@ page import="tss.options.*" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>

<script language="JavaScript" >

function formValidation()
{
        var d1=fm.project_name;
        var d2=fm.staff_name;
	if(isNull(d1,"Project Name ")||isNull(d2,"Staff Name"))
		return false;
    
	return true;
}

</script>

<%
	//Get A Staff Project Code list
	StaffOptions staffProjectOptions=new StaffOptions();
	ProjectOptions projectOptions = new ProjectOptions();

    //Get A Staff Project
    StaffProjectBean staffProject = (StaffProjectBean)request.getAttribute("staffProject");
    if (staffProject==null)
       staffProject = new StaffProject();

    boolean readonlyFlag = true;
    formAction = request.getParameter("formAction");
    if (formAction.equals("Create"))
	{
		readonlyFlag = false;
        }
    System.out.println(readonlyFlag);
%>
<body>

<h2>Staff Project Maintenance</h2>

<form id=fm method=post action=<%=contextPath%>/servlet/tss.staffproject.StaffProjectServlet>
<input type=hidden name=formAction value=<%=formAction%> >
<table cols=10 border=0 >
<tr>
  <td>Project Name</td>
  <td>&nbsp;</td>
  <td>

  <select name=project_name>
  <%=projectOptions.getOptions(staffProject.getProject_name(),readonlyFlag)%>
  </select>

  </td>
</tr>

<tr>
  <td>Staff Name</td>
  <td>&nbsp;</td>
  <td>

  <select name=staff_name>
  <%=staffProjectOptions.getOptions(staffProject.getStaff_no(),readonlyFlag)%>
  </select>

  </td>
</tr>

</table>
<br>
<hr>

<p>
  <%
    if (formAction.equals("Create"))
    {
  %>
  <INPUT type=button value=Save onclick="save()">
  <INPUT type=button value=Delete  onclick="deleteRecord()"  >
   <INPUT type=reset  value=Cancel >
 <INPUT type=button value=Back onclick=history.back() >
  <%
    }
    else
    {
  %>
  <INPUT type=button value=Delete  onclick="deleteRecord()"  >
  <INPUT type=button value=Back onclick=history.back() >
  <%
    }
  %>
</p>
</form>
<%@ include file="../tssfooter.jsp" %>
</body>
</body>
</html>

